import panel from './panel.vue'
const DANGER_LEVELS = [
  "hierarchy_abc",
  "hierarchy_a",
  "hierarchy_d",
  "hierarchy_q"
];
const source = {
  collectionName: "Hidden_Trouble_Investigation",
  options: {
    include: ["enterprise_name"],
    exists: "hidden_danger_position",
    notEqualTo: { state: 3 }
  }
}
const layer = {
  source: ["danger"],
  zoom: [16, 30],
  infoWindow: {
    component: panel,
    title: "danger_number"
  },
  marker: {
    coordinate: "hidden_danger_position",
    size: [26, 34],
    src: [
      require("./隐患_lv1.png"),
      require("./隐患_lv2.png"),
      require("./隐患_lv3.png"),
      require("./隐患_lv4.png")
    ],
    rule: prop => DANGER_LEVELS.indexOf(prop.list_level)
  }
}

export default {
  sources: { danger: source },
  layers: { danger: layer }
}
